﻿<common:LayoutAwarePage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:StudyTime_1"
    xmlns:common="using:StudyTime_1.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:UI="using:Microsoft.Advertising.WinRT.UI"
    x:Name="pageRoot"
    x:Class="StudyTime_1.quizBuilder1"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Mode=Self}}"
    IsTabStop="false"
    mc:Ignorable="d" Loaded="pageRoot_Loaded"  >

    <common:LayoutAwarePage.Resources>
        <Storyboard x:Name="quizBuilderStory">
            <PopInThemeAnimation  Storyboard.TargetName="addQuestion" FromHorizontalOffset="-1000"/>
            <PopInThemeAnimation  Storyboard.TargetName="saveAll" FromHorizontalOffset="-1000"/>
        </Storyboard>

    </common:LayoutAwarePage.Resources>



    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}" Background="#FF00B159">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>




        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>




        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="Quiz Builder" Style="{StaticResource PageHeaderTextStyle}"/>
        </Grid>

        <Grid HorizontalAlignment="Center" Height="655" Margin="0,5,0,0" Grid.Row="1" VerticalAlignment="Center" Width="1270">

            <TextBlock HorizontalAlignment="Left" Height="43" Margin="272,530,0,0" TextWrapping="Wrap" Text="Final Answer" VerticalAlignment="Top" Width="164" TextAlignment="Center" FontSize="16" Grid.Row="1"/>
            <TextBlock HorizontalAlignment="Left" Height="38" Margin="339,25,0,0" TextWrapping="Wrap" Text="Multiple Choice Quesions" VerticalAlignment="Top" Width="685" TextAlignment="Center" FontFamily="Segoe UI" FontSize="20"/>
            <TextBox x:Name ="multQuest" HorizontalAlignment="Left" Height="79" Margin="439,100,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="518" FontSize="14" IsSpellCheckEnabled="True"/>
            <TextBlock HorizontalAlignment="Left" Height="43" Margin="272,100,0,0" TextWrapping="Wrap" Text="Question" VerticalAlignment="Top" Width="164" TextAlignment="Center" FontSize="16" Grid.Row="1"/>
            <TextBox x:Name="answerA" HorizontalAlignment="Left" Height="78" Margin="439,185,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="518" IsSpellCheckEnabled="True"/>
            <TextBlock HorizontalAlignment="Left" Height="43" Margin="272,185,0,0" TextWrapping="Wrap" Text="Answer A" VerticalAlignment="Top" Width="164" TextAlignment="Center" FontSize="16" Grid.Row="1"/>
            <TextBox x:Name="answerB" HorizontalAlignment="Left" Height="79" Margin="439,269,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="518" IsSpellCheckEnabled="True"/>
            <TextBlock HorizontalAlignment="Left" Height="43" Margin="272,269,0,0" TextWrapping="Wrap" Text="Answer B" VerticalAlignment="Top" Width="164" TextAlignment="Center" FontSize="16" Grid.Row="1"/>
            <TextBox x:Name="answerC" HorizontalAlignment="Left" Height="84" Margin="439,354,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="518" IsSpellCheckEnabled="True"/>
            <TextBlock HorizontalAlignment="Left" Height="42" Margin="272,354,0,0" TextWrapping="Wrap" Text="Answer C" VerticalAlignment="Top" Width="164" TextAlignment="Center" FontSize="16" Grid.Row="1"/>
            <TextBox x:Name="answerD" HorizontalAlignment="Left" Height="80" Margin="439,444,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="518" IsSpellCheckEnabled="True"/>
            <TextBlock HorizontalAlignment="Left" Height="43" Margin="272,444,0,0" TextWrapping="Wrap" Text="Answer D" VerticalAlignment="Top" Width="164" TextAlignment="Center" FontSize="16" Grid.Row="1"/>
            <TextBox x:Name="finalAnswer" HorizontalAlignment="Left" Height="43" Margin="439,530,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="81" IsSpellCheckEnabled="True"/>
            <Button  x:Name="addQuestion" Content="Add Question" HorizontalAlignment="Left" Height="87" Margin="30,335,0,0" VerticalAlignment="Top" Width="237" RenderTransformOrigin="0.5,0.5" Click="Button_Click_1" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <Button.RenderTransform>
                    <CompositeTransform SkewY="-20"/>
                </Button.RenderTransform>
            </Button>
            <TextBlock x:Name="errorBox" HorizontalAlignment="Left" Height="77" Margin="969,-103,-23,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="324" FontSize="18" Foreground="#FFF70808"/>
            <Button x:Name="saveAll" Content="Save All" HorizontalAlignment="Left" Height="87" Margin="30,439,0,0" VerticalAlignment="Top" Width="237" Click="saveAll_Click" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <Button.RenderTransform>
                    <CompositeTransform SkewY="-20"/>
                </Button.RenderTransform>
            </Button>
            <Button  x:Name="addImage" Content="Add Image" HorizontalAlignment="Left" Height="87" Margin="1002,335,0,0" VerticalAlignment="Top" Width="237" RenderTransformOrigin="0.5,0.5"  UseLayoutRounding="False" d:LayoutRounding="Auto" Click="addImage_Click">
                <Button.RenderTransform>
                    <CompositeTransform SkewY="20"/>
                </Button.RenderTransform>
            </Button>
            <Button  x:Name="openDeck" Content="Open Quiz" HorizontalAlignment="Left" Height="87" Margin="1002,439,0,0" VerticalAlignment="Top" Width="237" RenderTransformOrigin="0.5,0.5"  UseLayoutRounding="False" d:LayoutRounding="Auto" Click="openDeck_Click" >
                <Button.RenderTransform>
                    <CompositeTransform SkewY="20"/>
                </Button.RenderTransform>
            </Button>
            <!--<UI:AdControl ApplicationId="testclient" AdUnitId="ADPT44" HorizontalAlignment="Left" Height="155" Margin="10,24,0,0" VerticalAlignment="Top" Width="150"/>-->
        </Grid>

    </Grid>
</common:LayoutAwarePage>
